<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>大咖观看</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../../css/main.css" />
    <style>
        body {
            background-color: #fff;
        }

        .lists {
            padding: 8px 15px 0px 15px;
        }

        .content1 {
            width: 52%;
            float: left;
            height: 88px;
            padding: 10px 0px 0px 7px;
        }

        .content_wenzi {
            font-size: 11px;
            color: #A7A7A7;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            padding-top: 3px;
        }

        .shuoming {
            font-size: 10px;
            position: absolute;
            bottom: 5px;
            color: #A7A7A7;
        }

        .test {
            position: relative;
        }

        .right {
            right: 0px;
        }

        .title {
            font-size: 16px;
            padding: 0px 24px 10px 24px;
            border-bottom: 1px solid #7d7d7d;
        }

        .content_title {
            color: #000;
            font-size: 15px;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            overflow: hidden;
        }

        .img_picture {
            float: left;
            width: 46%;
            height: 80px;
            border-radius: 8px;
        }

        .tupian{
          position: relative;
        }
        .aui-clearfix2{
          height: 25px;
        }


    </style>
</head>

<body>
    <div id="vm" v-cloak>
        <div class="title">{{authorname}}</div>
        <div class="lists">
            <div style="margin-top:5px;" @click="Openjieshao(item)" v-for="item in authorvideolist">
                <div class="tupian">
                    <!-- <span class="videotype" :class="{videotypedaka:item.video_type==3,videotypemianfei:item.video_type==1}">{{videotype(item.video_type)}}</span> -->
                    <img v-bind:src="item.img" alt="" class="img_picture">
                </div>
                <div class="content1 test">
                    <p class="content_title">{{item.video_name}}</p>
                    <p class="content_wenzi">{{item.video_introduce_small}}</p>
                    <div class="shuoming">观看人次：{{item.watch_count}}</div>
                    <!-- <div class="shuoming right">{{watchtime(item.addtime)}}</div> -->
                </div>
                <div class="aui-clearfix"></div>
            </div>
        </div>
<div class="aui-clearfix2"></div>
    </div>
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/rest.js"></script>
<script type="text/javascript" src="../../script/vue.2.5.js"></script>
<script type="text/javascript" src="../../script/showdate.js"></script>
<script type="text/javascript" src="../../script/faskclick.js"></script>
<script type="text/javascript">
    var uid, session;
    var vm = new Vue({
        el: '#vm',
        data: {
            authorvideolist: [],
            authorname: '',
        },
        created: function() {
            var _this = this;
            uid = $api.getStorage('uid');
            session = $api.getStorage('session');
            apiready = function() {
                _this.init();
                api.parseTapmode();
                var header = $api.byId('aui-header');
                $api.fixStatusBar(header);
                var headerPos = $api.offset(header);
                if ('addEventListener' in document) {
                    document.addEventListener('DOMContentLoaded', function() {
                        FastClick.attach(document.body);
                    }, false);
                }

            }
        },
        methods: {
            init: function() {
                var _this = this;
                _this.authorname = api.pageParam.authorname;
                api.addEventListener({
                    name: 'scrolltobottom',
                    extra: {
                        threshold: 80 //设置距离底部多少距离时触发，默认值为0，数字类型
                    }
                }, function(ret, err) {
                    _this.page = _this.page + 1;
                    _this.getauthorvideo();
                });
                _this.getauthorvideo();
            },
            videotype: function(res) {
                if (res == 2) {
                    return 'VIP'
                } else if (res == 3) {
                    return '大咖'
                } else {
                    return '免费'
                }
            },
            Openjieshao: function(item) {
              var _this = this;
              if(uid){
                var data1={
                  video_id: item.id,
                  uid: uid
                }
              }else{
                var data1={
                  video_id: item.id,
                  uid: ''
                }
              }
              api.sendEvent({
                  name: 'allauthorvideo',
                  extra: {
                      videoid: item.id
                  }
              });
              api.closeWin({

              });

              // new rest().get('getDetail').datae(data1).success(function(res) {
              //     console.log(JSON.stringify(res))
              //     if (res.flag == 1) {
              //       if(item.isonline=='2'){
              //         api.toast({
              //             msg: '该视频已下架',
              //             duration: 2000,
              //             location: 'middle'
              //         });
              //       }else{
              //         _this.videodetial = res.msg;
                      // api.openWin({
                      //     name: 'videodetail_win',
                      //     url: 'videodeail.html',
                      //     pageParam: {
                      //         videoid: item.id
                      //     },
                      //     reload:true
                      // });
                    // }
                  // }
                  // else{
                  //   api.toast({
                  //       msg: '视频不存在',
                  //       duration: 2000,
                  //       location: 'middle'
                  //   });
                  // }
              // }).error(function(err) {
              //     console.log(JSON.stringify(err))
              // }).run()
            },
            watchtime(riqi) {
                return Mou.watchtime(riqi);
            },
            getauthorvideo() {
                var _this = this;
                // 作者相关视频
                new rest().post('getAuthorVideo').datae({
                    author: api.pageParam.authorid,
                    video_id: api.pageParam.videoid,
                }).success(function(res) {
                    if (res.flag == 1) {
                        _this.authorvideolist = res.msg;
                    } else {
                        api.toast({
                            msg: res.msg,
                            duration: 2000,
                            location: 'middle'
                        });
                    }
                }).error(function(err) {
                    api.toast({
                        msg: err.msg,
                        duration: 2000,
                        location: 'middle'
                    });
                }).run()
            },
        }
    })
</script>

</html>
